// WzPageAniTypeFrame.cpp : implementation file
//

#include "stdafx.h"
#include "ansieditor.h"
#include "WzPageAniTypeFrame.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CWzPageAniTypeFrame dialog


CWzPageAniTypeFrame::CWzPageAniTypeFrame(CWnd* pParent /*=NULL*/)
	: CWizardPage(CWzPageAniTypeFrame::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWzPageAniTypeFrame)
	//}}AFX_DATA_INIT
	m_pFocusTarget = &m_chkAutoInsert;
}


void CWzPageAniTypeFrame::DoDataExchange(CDataExchange* pDX)
{
	CWizardPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWzPageAniTypeFrame)
	DDX_Control(pDX, IDC_SPIN_LINECOUNT, m_spinLineCount);
	DDX_Control(pDX, IDC_TXT_PROLOG, m_txtProlog);
	DDX_Control(pDX, IDC_CHK_AUTOINSERT, m_chkAutoInsert);
	//}}AFX_DATA_MAP
	DDX_Text(pDX, IDC_TXT_PROLOG, m_pData->m_sProlog);
	DDX_Check(pDX, IDC_CHK_GENERATE_PROLOG, m_pData->m_bGenerateProlog);
	DDX_Check(pDX, IDC_CHK_AUTOINSERT, m_pData->m_bAutoInsert);
	DDX_Text(pDX, IDC_TXT_LINECOUNT, m_pData->m_nFrameLineCount);
	DDV_MinMaxInt(pDX, m_pData->m_nFrameLineCount, 1, 100);
}


BEGIN_MESSAGE_MAP(CWzPageAniTypeFrame, CWizardPage)
	//{{AFX_MSG_MAP(CWzPageAniTypeFrame)
	ON_BN_CLICKED(IDC_CHK_GENERATE_PROLOG, OnChkGenerateProlog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWzPageAniTypeFrame message handlers

BOOL CWzPageAniTypeFrame::OnInitDialog() 
{
	CWizardPage::OnInitDialog();

	m_spinLineCount.SetRange32(1, 100);
	OnChkGenerateProlog();
	return TRUE;
}

void CWzPageAniTypeFrame::OnChkGenerateProlog() 
{
	UpdateData();
	m_txtProlog.EnableWindow(m_pData->m_bGenerateProlog);
	GetDlgItem(IDC_STATIC_1)->EnableWindow(m_pData->m_bGenerateProlog);
}

BOOL CWzPageAniTypeFrame::ValidatePage()
{
	if(!UpdateData())
	{
		return FALSE;
	}
	return CWizardPage::ValidatePage();
}
